// pages/son/Course_grade.js
const app = getApp();
Page({
  /**
   * 页面的初始数据
   */
  data: {
    value: [9999, 1, 1],
    range:[['0'],['0']],
    
  },

  /**
   * 生命周期函数--监听页面加载
   */
  bindcolumnchange:function(e){
    if(e.detail.column==0){
    const empty_classroom_1 = new Array();
    const empty_classroom_2 = new Array();
    for (var j=0;j<20;j++) {
      empty_classroom_2[j] = new Array();;
    }
    var m=0;
    for (var key1 in app.globalData.empty_classroom) {
      empty_classroom_1.push(key1);
      for (var key2 in app.globalData.empty_classroom[e.detail.value+1]) {
        empty_classroom_2[m].push(key2);
      }
      m++;
    }
    empty_classroom_1.splice(0, 1);
    this.setData({
      range: [empty_classroom_1, empty_classroom_2[e.detail.value]],
    })
   
    //取得区域与教学楼
    empty_classroom_1.splice(0, 1);
    empty_classroom_2.splice(0, 2);
    function isBigEnough(element) {
      return element != null;
    }//filter_function
    var empty_classroom_2_f = empty_classroom_2.filter(isBigEnough);
   



 

    }
  }
  ,
  onLoad: function (options) {
    wx.setNavigationBarTitle({
      title: '空教室查询'
    })
    wx.setNavigationBarColor({
      frontColor: '#ffffff',
      backgroundColor: '#16A3A6',
      animation: {
        duration: 400,
        timingFunc: 'easeIn'
      }
    })
    
    const empty_classroom_1 = new Array();

    for (var key1 in app.globalData.empty_classroom) {
      empty_classroom_1.push(key1);
    }//取得区域与教学楼
    empty_classroom_1.splice(0, 1);
   /* function isBigEnough(element) {
      return element != null;
    }//filter_function
    var empty_classroom_2_f = empty_classroom_2.filter(isBigEnough);
    */
    this.setData({
      range: [empty_classroom_1,['']]
    })

   
    
  },
 
   

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {
  
  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {
  
  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {
  
  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {
  
  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {
  
  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {
  
  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {
  
  }
})